﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:BrokenHouse.Windows.Parts.Transition">

    <Style x:Key="STYLE_AtStart" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <GeometryDrawing Brush="White">
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <RectangleGeometry Rect="1,0,0,1" />
                                    <RectangleGeometry Rect="0,1,0,1"/>
                                    <RectangleGeometry Rect="1,0,0,1" />
                                    <RectangleGeometry Rect="2,1,0,1"/>
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="STYLE_AtCenter" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <GeometryDrawing Brush="White">
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <RectangleGeometry Rect="0,0,1,1" />
                                    <RectangleGeometry Rect="0,1,1,1"/>
                                    <RectangleGeometry Rect="1,0,1,1" />
                                    <RectangleGeometry Rect="1,1,1,1"/>
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="STYLE_AtEnd" TargetType="{x:Type local:TransitionFrame}" 
           BasedOn="{StaticResource {x:Static local:TransitionElements.TransitionFrameStyleKey}}" >
        <Setter Property="OpacityMask">
            <Setter.Value>
                <DrawingBrush TileMode="Tile" ViewboxUnits="Absolute" Viewbox="0,0,2,2" Viewport="0,0,60,60" ViewportUnits="Absolute">
                    <DrawingBrush.Drawing>
                        <GeometryDrawing Brush="White">
                            <GeometryDrawing.Geometry>
                                <GeometryGroup>
                                    <RectangleGeometry Rect="0,0,0,1" />
                                    <RectangleGeometry Rect="1,1,0,1"/>
                                    <RectangleGeometry Rect="2,0,0,1" />
                                    <RectangleGeometry Rect="1,1,0,1"/>
                                </GeometryGroup>
                            </GeometryDrawing.Geometry>
                        </GeometryDrawing>
                    </DrawingBrush.Drawing>
                </DrawingBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Storyboard x:Key="TRANS_ToStart">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[0].Rect" To="1,0,0,1" Duration="0:0:1" />
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[1].Rect" To="0,1,0,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[2].Rect" To="1,0,0,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[3].Rect" To="2,1,0,1" Duration="0:0:1"/>
    </Storyboard>

    <Storyboard x:Key="TRANS_ToCenter">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[0].Rect" To="0,0,1,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[1].Rect" To="0,1,1,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[2].Rect" To="1,0,1,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[3].Rect" To="1,1,1,1" Duration="0:0:1"/>
    </Storyboard>

    <Storyboard x:Key="TRANS_ToEnd">
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[0].Rect" To="0,0,0,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[1].Rect" To="1,1,0,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[2].Rect" To="2,0,0,1" Duration="0:0:1"/>
        <RectAnimation Storyboard.TargetProperty="OpacityMask.Drawing.Geometry.Children[3].Rect" To="1,1,0,1" Duration="0:0:1"/>
    </Storyboard>
</ResourceDictionary>
